package com.threadpool;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * Created by 石头哥哥 on 9/8/16.
 * PACKAGE_NAME:  com.threadpool
 * COMMENT :
 */
@SpringBootApplication
public class ThreadPoolWorkApplication {

    @Resource
    private ThreadPoolWork threadPoolWork;

    public static void main(String[] args) throws IOException {
        System.loadLibrary("threadpool");
        ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(ThreadPoolWorkApplication.class, args);
        ThreadPoolWorkApplication threadPoolWorkApplication = (ThreadPoolWorkApplication) configurableApplicationContext.getBean("threadPoolWorkApplication");
        threadPoolWorkApplication.threadPoolWork.startThreadPool();
        System.out.println("number change:" + threadPoolWorkApplication.threadPoolWork.getNumber());
        System.out.println("name :" + threadPoolWorkApplication.threadPoolWork.getName());

    }


}
